package com.archstoday.fragment;

import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.archstoday.BaseApp;
import com.archstoday.R;
import com.archstoday.common.SpfUtils;
import com.archstoday.entity.BaseEntity;
import com.base.activity.BaseFragment;
import com.base.http.common.BaseHttpClient;
import com.base.utils.MySharedPreferencesMgr;

public class AsBaseFragment extends BaseFragment {


    public void getEvent(String e, String pageType) {
        initParameter();
        mParams.put("e", e);
        mParams.put("accountId", MySharedPreferencesMgr.getString(SpfUtils.USER_ID, null));
        mParams.put("deviceId", BaseApp.getDeviceID(mAct));
        mParams.put("platform", "android");
        mParams.put("appId", "200000");
        mParams.put("pageType", pageType);

        sendGetRequest(BaseApp.EVENT_URL, "event", mParams, BaseEntity.class);
    }

    public void getEvent(String e, String pageType, String info) {
        initParameter();
        mParams.put("e", e);
        mParams.put("accountId", MySharedPreferencesMgr.getString(SpfUtils.USER_ID, null));
        mParams.put("deviceId", BaseApp.getDeviceID(mAct));
        mParams.put("platform", "android");
        mParams.put("appId", "200000");
        mParams.put("pageType", pageType);
        mParams.put("info", info);

        sendGetRequest(BaseApp.EVENT_URL, "event", mParams, BaseEntity.class);
    }

    @Override
    protected View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return null;
    }

    @Override
    protected void initData(Bundle savedInstanceState) {

    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void onSuccess(String content, BaseHttpClient client, Object parse) {

    }

    @Override
    protected void onError(Throwable error, BaseHttpClient client) {

    }

//    Runnable runnable = new Runnable() {
//        @Override
//        public void run() {
//            showToast(R.string.intent_error);
//        }
//    };
}